﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/4/7 星期日 21:32:22
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Framework.DataDictionary.Utility;
using Sector7.Framework.Core;
using Sector7.Framework.DataDictionary.CORS;

namespace Sector7.Framework.DataDictionary.Agents
{
    /// <summary>
    /// 系统服务代理
    /// </summary>
    public class SystemServiceAgent
    {
        /// <summary>
        /// 初始化数据库
        /// </summary>
        /// <returns>操作结果</returns>
        public static int InitializeDatabase()
        {
            return WcfClient.GetInstance().Invoke<int>(
                service => service.InitializeDatabase());
        }

        /// <summary>
        /// 将数据插入表
        /// </summary>
        /// <param name="connectionString">数据库连接字符串</param>
        /// <param name="datas">要插入的数据</param>
        /// <returns></returns>
        public static int InitiallizeDatabaseTable(string connectionString, List<S7_DatabaseTable> datas)
        {
            return WcfClient.GetInstance().Invoke<int>(
                service => service.InsertDatasToTable(connectionString, datas));
        }
    }
}
